package com.demo.serviceI.TestI;

import com.demo.service.Test.Testservice;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;

@Service
public class TestServiceI implements Testservice {



    @Override
    //注解表示这是要验证的方法
    //方法内是 具体验证到那个权限放行
    @PreAuthorize("hasAuthority('admin:query')")
    public String query() {
        return "查询boy成功";
    }

    @Override
    @PreAuthorize("hasAuthority('admin:add')")
    public String add() {
        return "添加boy成功";
    }

    @Override
    @PreAuthorize("hasAuthority('admin:del')")
    public String del() {
        return "删除boy成功";
    }

    @Override
    @PreAuthorize("hasAuthority('admin:update')")
    public String update() {
        return "修改boy成功";
    }
}
